<?php
  defined('BASEPATH') or die ('No direct script access allowed');
  
  class User extends Controller {
  	
  	function User() {
  		parent::Controller();
  		$this->load->model('user_model');
  	}
  	/**
  	 * 注册用户
  	 *
  	 */
  	function registerUser() {
  		//$name = $this->input->post('name');
  		$username = $this->input->post('username');
  		$email = $this->input->post('email');
  		$password = $this->input->post('password');
  		$userType = $this->input->post('userType');
  		
  		$this->load->model('user_model');
  		
  		$user = array("username" => $username, "email" => $email, "password" => $password,
  		              "user_type" => $userType);
  		
  		$this->user_model->registerUser($user);
  	}
  }